home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / util / sys / InstallerNG.lha / InstallerNG / Install < prev    next >
Text File  |  2000-11-01  |  13KB  |  330 lines

  1.  
  2. /*********************************************************************************************
  3.  *
  4.  * installation script for the InstallerNG $VER: InstallerNG-Script 1.2 (08.10.99)
  5.  *
  6.  * note, that this script makes use of seveal new features of the InstallerNG
  7.  * like multilined comments and enhanced pattern-match functionality of the DATABASE
  8.  * function
  9.  *
  10.  *********************************************************************************************/
  11.  
  12. ; -----------------------------------------------------------------------------
  13. ; some default settings
  14.  
  15. (set @app-name     "Installer NG"
  16.      @default-dest "C:"
  17. )
  18.  
  19. ; -----------------------------------------------------------------------------
  20. ; initialize the sound
  21.  
  22. (effect "lower_center" "horizontal" $000000 $33FF33)
  23.  
  24. (showmedia "#yeah" "media/yeah" "upper_left" "none" 0)
  25. (showmedia "#logo" "media/logo" "upper_left" "none" 0)
  26.  
  27. ; -----------------------------------------------------------------------------
  28. ; localized strings; by default, everything is english, but if possible,
  29. ; overwrite the english strings by user-preferred ones
  30.  
  31. (set #msg_welcome (cat "Welcome to the Installation of the InstallerNG\n\n"
  32.                        "The InstallerNG wants to be a substitution of\n"
  33.                        "the original Installer by C=\n"
  34.                        "It offers many new features, looks much better and is\n"
  35.                        "smaller than the C= Installer"
  36.                        "\n\n\n\n.oO please turn on the Amiga sound Oo."
  37.                   )
  38. )
  39. (set #msg_askfile_prompt "Where is the default Installer located?")
  40. (set #msg_askfile_help (cat "Please select the original Installer by C=. "
  41.                             "This script will make a backup copy of the "
  42.                             "Installer and then, it will replace the "
  43.                             "original by the new InstallerNG."
  44.                        )
  45. )
  46. (set #msg_copylib_prompt "Now copying the InstallerNG to \"%s\"")
  47. (set #msg_copylib_help "...")
  48.  
  49. (set #msg_catalog_prompt "Which catalog-file do you want to install?")
  50. (set #msg_catalog_help "...")
  51.  
  52. (set #msg_done (cat "Done!\n"
  53.                     "The InstallerNG replaced the original Installer\n"
  54.                     "and made a copy of the old one in \"%s\".\n\n"
  55.                     "Have fun with the new Installer and its features"
  56.                )
  57. )
  58.  
  59. (set #msg_rename_prompt "Now renaming the C= installer")
  60. (set #msg_rename_help "...")
  61.  
  62. (set #msg_copytools_prompt "Which additional tools you want to install? (see Help)")
  63. (set #msg_copytools_help (cat "CloseScreenPatch\nA patch, which avoids screen closing, while a window "
  64.                               "is still open on that screen and helps you to save memory. Just add "
  65.                               "'run <>nil: c:closescreenpatch' to the end of your 's:user-startup' file"
  66.                               "\n\nGetSum\n"
  67.                               "Calculates the checksum of any file, like the Installer does. "
  68.                               "Usage: type 'getsum <file>' in your shell"
  69.                          )
  70. )
  71.  
  72. (set #msg_tooltypes_prompt "Which Tooltypes you want to preset?")
  73. (set #msg_tooltypes_help (cat "LAZYCOMPILE -- to be more compatible to the C= Installer\n\n"
  74.                               "DEBUGMODE -- turn on useful runtime warnings and enable output for the DEBUG function\n\n"
  75.                               "CREATEUNSINSTALL -- write an UnInstall script (beta!)\n\n"
  76.                               "COPYFILESCOMMENT -- comment every copied file and every created directory with the Package name\n\n"
  77.                               "ALWAYSCONFIRM -- the user must confirm every single operation\n\n"
  78.                               "NOSYSDELETE -- avoid to delete from system directories"
  79.                          )
  80. )
  81.  
  82. (set #msg_askchoice_prompt "Which GUI do you want to use?")
  83. (set #msg_askchoice_help "...")
  84.  
  85. (set #message_letsgo "Installation prepared. Ready to proceed?")
  86.  
  87. (set #working_text "Now starting to install the new InstallerNG by Jens Tröger")
  88.  
  89. ; -----------------------------------------------------------------------------
  90. ; if we should switch to german, then here we go
  91.  
  92. (if (= @language "deutsch")
  93.  
  94.     (
  95.       (set #msg_welcome (cat "Willkommen zur Installation des InstallerNG\n\n"
  96.                              "Der InstallerNG soll ein Ersatz für den\n"
  97.                              "originalen Installer von C= sein\n"
  98.                              "Er bietet viele neue Eigenschaften, sieht viel besser aus\n"
  99.                              "und ist kleiner als der C= Installer"
  100.                              "\n\n\n\n.oO Bitte den Amiga-Ton anschalten Oo."
  101.                         )
  102.       )
  103.  
  104.       (set #msg_askfile_prompt "Wo befindet sich der Installer?")
  105.       (set #msg_askfile_help (cat "Bitte wählen Sie den originalen Installer von C=. "
  106.                                   "Dieses Skript macht eine Kopie des originalen "
  107.                                   "Installers und wird danach den originalen durch "
  108.                                   "den neuen InstallerNG ersetzen."
  109.                              )
  110.       )
  111.  
  112.       (set #msg_copylib_prompt "Kopiere jetzt den InstallerNG nach \"%s\"")
  113.       (set #msg_copylib_help "...")
  114.  
  115.       (set #msg_catalog_prompt "Zu welcher Sprache möchten Sie einen Katalog installieren?")
  116.       (set #msg_catalog_help (cat "Wählen Sie hier aus, welche Katalog Datei Sie installieren möchten. "
  117.                                   "Sinnigerweise sollten Sie 'deutsch' wählen."
  118.                              )
  119.       )
  120.  
  121.       (set #msg_done (cat "Fertig!\n"
  122.                           "Der InstallerNG hat Ihren originalen Installer\n"
  123.                           "ersetzt und eine Kopie des alten als \"%s\" erzeugt.\n\n"
  124.                           "Viel Spaß mit dem neuen Installer und seinen Möglichkeiten"
  125.                      )
  126.       )
  127.  
  128.       (set #msg_rename_prompt "Benenne nun den C= Installer um")
  129.       (set #msg_rename_help "...")
  130.  
  131.       (set #msg_copytools_prompt "Welche zusätzlichen Programme wollen Sie installieren?")
  132.       (set #msg_copytools_help (cat "CloseScreenPatch\nEin Patch, welcher verhindert, daß ein Screen geschlossen "
  133.                                     "wird, auf dem noch Fenster geöffnet sind und somit 'Speicherleichen' "
  134.                                     "vorbeugt. Einfach 'run <>nil: c:closescreenpatch' in 's:user-startup' einfügen"
  135.                                     "\n\nGetSum\n"
  136.                                     "Berechnet die Checksumme einer Datei, wie sie auch der Installer berechnet. "
  137.                                     "Nutzung: 'getsum <file>' in der Shell eingeben"
  138.                                )
  139.       )
  140.  
  141.       (set #msg_tooltypes_prompt "Welche Tooltypes möchten Sie voreinstellen? (siehe Hilfe)")
  142.       ; (set #msg_tooltypes_help "...")  ---> preset
  143.  
  144.       (set #msg_askchoice_prompt "Welche Oberfläche möchten Sie verwenden?")
  145.       (set #msg_askchoice_help "...")
  146.  
  147.       (set #message_letsgo "Installation vorbereitet. Soll nun weitergemacht werden?")
  148.  
  149.       (set #working_text "Beginne nun mit der Installation des InstallersNG von Jens Tröger")
  150.     )
  151. )
  152.  
  153. /*********************************************************************************************/
  154.  
  155. (user expert)
  156. (message #msg_welcome)
  157. (setmedia #yeah "play")
  158. (welcome)
  159.  
  160. ; -----------------------------------------------------------------------------
  161. ; the default settings
  162.  
  163. (set #default_installer "c:installer"
  164.      #default_catalog 0
  165.      #default_tools 0
  166.      #default_tooltypes 0
  167.      #default_gui 0
  168. )
  169.  
  170. ; -----------------------------------------------------------------------------
  171. ; first of all let the user make all the required settings
  172. ; for the installation
  173.  
  174. (swing
  175.  
  176.   (set @default-dest (pathonly (set #default_installer (askfile (prompt #msg_askfile_prompt)
  177.                                                                 (default #default_installer)
  178.                                                                 (help #msg_askfile_help)
  179.                                                        )
  180.                                )
  181.                      )
  182.   )
  183.  
  184.   (set #default_catalog (askoptions (prompt #msg_catalog_prompt)
  185.                                     (help #msg_catalog_help)
  186.                                     (default #default_catalog)
  187.                                     (choices (if (exists "catalogs/deutsch/installerng.catalog") "Deutsch" "")
  188.                                              (if (exists "catalogs/français/installerng.catalog") "Français" "")
  189.                                     )
  190.                         )
  191.   )
  192.  
  193.   (set #default_tools (askoptions (prompt #msg_copytools_prompt)
  194.                                   (help #msg_copytools_help)
  195.                                   (default #default_tools)
  196.                                   (choices "CloseScreenPatch" "GetSum")
  197.                       )
  198.   )
  199.  
  200.   (set #default_tooltypes (askoptions (prompt #msg_tooltypes_prompt)
  201.                                       (help #msg_tooltypes_help)
  202.                                       (default #default_tooltypes)
  203.                                       (choices "LAZYCOMPILE" "DEBUGMODE"
  204.                                                "CREATEUNSINSTALL" "COPYFILESCOMMENT"
  205.                                                "ALWAYSCONFIRM" "NOSYSDELETE"
  206.                                       )
  207.                           )
  208.   )
  209.  
  210.   (set #default_gui (askchoice (prompt #msg_askchoice_prompt)
  211.                                (help #msg_askchoice_help)
  212.                                (default #default_gui)
  213.                                (choices "BOOPSI by Savage (builtin)"
  214.                                         "MUI by Savage (BETA!)"
  215.                                )
  216.                     )
  217.   )
  218.  
  219.   (message #message_letsgo)
  220. )
  221.  
  222. ; -----------------------------------------------------------------------------
  223. ; now the installation process itself
  224.  
  225. (complete 0)
  226.  
  227. (set #installer_backup (cat #default_installer ".backup"))
  228.  
  229. (if (not (exists #installer_backup (noreq)))
  230.     (
  231.       (rename #default_installer #installer_backup (confirm average)
  232.                                                    (prompt #msg_rename_prompt)
  233.                                                    (help #msg_rename_help)
  234.       )
  235.     )
  236.  
  237. (complete 15)
  238.  
  239. (copylib (prompt (#msg_copylib_prompt #default_installer))
  240.          (help #msg_copylib_help)
  241.          (confirm average)
  242.          (source (if (database "cpu" "(68000|68010)")
  243.                      "c/installerng.000"
  244.                      "c/installerng.020"
  245.                  )
  246.          )
  247.          (dest (pathonly #default_installer))
  248.          (newname (fileonly #default_installer))
  249.          (infos)
  250. )
  251.  
  252. (complete 30)
  253.  
  254. (copyfiles (source "tools/")
  255.            (dest "C:")
  256.            (choices (if (bitand #default_tools 1) "CloseScreenPatch")
  257.                     (if (bitand #default_tools 2) "GetSum")
  258.            )
  259. )
  260.  
  261. (complete 45)
  262.  
  263. (if (exists (tackon #default_installer ".info"))
  264.  
  265.     (tooltype (dest #default_installer)
  266.               (setstack 50000)
  267.               (if (bitand #default_tooltypes  1) (settooltype "LAZYCOMPILE" "")
  268.                                                  (settooltype "(LAZYCOMPILE)" ""))
  269.               (if (bitand #default_tooltypes  2) (settooltype "DEBUGMODE" "")
  270.                                                  (settooltype "(DEBUGMODE)" ""))
  271.               (if (bitand #default_tooltypes  4) (settooltype "CREATEUNINSTALL" "")
  272.                                                  (settooltype "(CREATEUNINSTALL)" ""))
  273.               (if (bitand #default_tooltypes  8) (settooltype "COPYFILECOMMENT" "")
  274.                                                  (settooltype "(COPYFILECOMMENT)" ""))
  275.               (if (bitand #default_tooltypes 16) (settooltype "ALWAYSCONFIRM" "")
  276.                                                  (settooltype "(ALWAYSCONFIRM)" ""))
  277.               (if (bitand #default_tooltypes 32) (settooltype "NOSYSDELETE" "")
  278.                                                  (settooltype "(NOSYSDELETE)" ""))
  279.     )
  280.  
  281.     (nop)
  282. )
  283.  
  284. (complete 60)
  285.  
  286. (if (bitand #default_catalog 1)
  287.     (copylib (source "catalogs/deutsch/installerng.catalog")
  288.              (dest "locale:catalogs/deutsch")
  289.     )
  290. )
  291.  
  292. (if (bitand #default_catalog 2)
  293.     (copylib (source "catalogs/français/installerng.catalog")
  294.              (dest "locale:catalogs/français")
  295.     )
  296. )
  297.  
  298. (complete 75)
  299.  
  300. (select #default_gui
  301.  
  302.         (nop)
  303.  
  304.         (copylib (source "libs/mui/installergui.library")
  305.                  (dest "libs:")
  306.         )
  307. )
  308.  
  309. (complete 100)
  310.  
  311. ; -----------------------------------------------------------------------------
  312. ; the final question
  313.  
  314. (if (askbool (prompt "RTFM ?")
  315.              (help "")
  316.     )
  317.  
  318.     (showmedia "#guide" (expandpath "docs/installerng.guide") "upper_right" "medium" 1 "panel")
  319. )
  320.  
  321. ; -----------------------------------------------------------------------------
  322. ; and done...
  323.  
  324. (setmedia #yeah "play")
  325. (exit (#msg_done #installer_backup))
  326.  
  327.  
  328.  
  329.